import request from "@/api/request";
import { type AxiosRequestConfig } from "axios";
import { type DeepRequired } from "../../interface";

/**
 * /download/download
 */
export function postDownloadDownload(params: PostDownloadDownloadParams, config?: AxiosRequestConfig) {
    const paramsInput = {
        md5: params.md5,
        fileName: params.fileName,
        chunkSize: params.chunkSize,
        chunkTotal: params.chunkTotal,
        index: params.index,
    };
    return request.post<DeepRequired<any>>(`/download/download`, null, {
        params: paramsInput,
        ...config,
    });
}

export interface PostDownloadDownloadParams {
    md5: string;
    fileName: string;
    chunkSize: number;
    chunkTotal: number;
    index: number;
}
